package com.itshi.demo1;

import java.util.Scanner;

/**
 * @author YS
 * @date 2021/7/3
 */
public class Test02 {
    public static void main(String[] args) {
        int[] arr = {1438, 9257,4,48,15,441};
        int a = arr.length-1;
        int tmp = 0;
        for (int i = 0; i < arr.length; i++,a--) {
            if(i >= a){
                break;
            }
            tmp = arr[i];
            arr[i] = arr[a];
            arr[a] = tmp;
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }
}
/*
    public static void main(String[] args){
        //定义数组
        int[] arr = {12, 45, 98, 73, 60};
        //定义一个变量, 记录数组的第一个元素
        int max = arr[0];
        //遍历数组
        for (int i = 1; i < arr.length; i++) {
            //取出数组的每一个元素, 和 max 进行比较
            if (arr[i] > max){
                max = arr[i];
            }
        }
        System.out.println(max);
    }
 */
/*
Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        //int temin = a<b?a:b; //比较得出临时最小数
       // int min = temin <c?temin:c;  //得出最小数
        int d;

        int temax = a>b?a:b; //得出临时最大数

        int max = temax >c?temax:c;  //得出最大数
        d=c;
        c=max;
        /*if((a<b&&a>c)||(a>b&&a<c)){   //找出中间数，并将它赋予给b
            b = a;
        }else if((c<b&&c>a)||(c>b&&c<a)){
           b = c;
        }
        a = min;
        c = max;
        System.out.println("最小数是:"+a);
        System.out.println("中间数是:"+b);
        System.out.println("最大数是:"+c);*/
